/**
 * @file commonapi.cpp
 * @author your name (you@domain.com)
 * @brief 
 * @version 0.1
 * @date 2022-10-20
 * 
 * @copyright Copyright (c) 2022
 * 
 */
#include "commonapi.h"
#include <QCameraInfo>
#include <utility>

CommonAPI::CommonAPI(QObject* parent) : QObject{parent} {}

QStringList CommonAPI::getCameralist() {
  auto infos = QCameraInfo::availableCameras();
  QStringList cameralist;
  for (const auto& info : infos) {
    cameralist.append(info.deviceName());
  }

  return std::move(cameralist);
}

QString CommonAPI::getDefaultCamera() {
  return QCameraInfo::defaultCamera().deviceName();
}
